# -*- makefile -*-
CC=gcc
CFLAGS=-Wall -Werror -pedantic -std=c99
LDFLAGS=
EXECUTABLES=Acrodictlibre Acrolibre

# default rule (the first one)
all : $(EXECUTABLES)
# explicit link target
Acrolibre: acrolibre.o
	$(CC)  $(CFLAGS) -o $@ $^
# explicit link and compile target
Acrodictlibre: acrolibre.c acrodict.o
	$(CC)  $(CFLAGS) -DUSE_ACRODICT -o $@ $^

# Implicit rule using file extension
# Every .o file depends on corresponding .c (and may be .h) file
%.o : %.c %.h
	$(CC) $(CFLAGS) -c $<
%.o : %.c
	$(CC) $(CFLAGS) -c $<
clean:
	@\rm -f *.o $(EXECUTABLES)
